package com.hifar.mybatisplus;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

public interface CollectPublicMapperService {
	Map<String, Object> selectOneBySql(@Param("sql") String sql);
	
	public <T,E> Page<T> listPage(Page<E> rowPage, String sql, QueryWrapper<E> wrapper,Class<T> classT ) ;
	public <T> List<T> selectList(@Param("sql") String sql, @Param(Constants.WRAPPER) QueryWrapper wrapper,Class<T> classT );
	

	public Page<Map<String, Object>> listPage(Page<Map<String, Object>> rowPage, @Param("sql") String sql,
			@Param(Constants.WRAPPER) QueryWrapper wrapper);
	
	List<Map<String, Object>> selectList(@Param("sql") String sql, @Param(Constants.WRAPPER) QueryWrapper wrapper);

	Map<String, Object> selectOneById(@Param("tableName") String tableName,
			@Param(Constants.WRAPPER) QueryWrapper wrapper);

	

	Map<String, Object> selectOneByIdField(@Param("selectFields") String selectFields,
			@Param("tableName") String tableName, @Param(Constants.WRAPPER) QueryWrapper wrapper);

	List<Map<String, Object>> selectListField(@Param("selectFields") String selectFields,
			@Param("tableName") String tableName, @Param(Constants.WRAPPER) QueryWrapper wrapper);

	void insert(@Param("tableName") String tableName, @Param("list") List<MetaField> list);

	void update(@Param("tableName") String tableName, @Param(Constants.WRAPPER) QueryWrapper wrapper,
			@Param("list") List<MetaField> list);

	void delete(@Param("tableName") String tableName, @Param(Constants.WRAPPER) QueryWrapper wrapper);
}
